package net.csdn.business.common.domain.request;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 验证码登录校验
 *
 * @author WangHang
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CodeLoginDto implements Serializable {

    /**
     * 验证码登录方式
     * 1-手机验证码 2-邮箱验证码
     */
    @Min(value = 1, message = "type must be 1 or 2")
    @Max(value = 2, message = "type must be 1 or 2")
    @NotNull(message = "type must be 1 or 2")
    private Integer type;

    @NotBlank(message = "账号不能为空")
    private String account;

    @NotBlank(message = "验证码不能为空")
    private String code;

}
